﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Collections.ObjectModel;

namespace PJ.Business
{
    public interface IEntityFragmentService : IBusinessObjectService
    {
        /// <summary>
        /// Gets the parent fragments list
        /// </summary>
        /// <param name="parentId">The parent Entity id</param>
        /// <returns>The collection of fragment object global ids</returns>
        /// <exception cref="ArgumentNullException">If <paramref name="parent"/> is <see langref="null"/> or empty.</exception>
        /// <exception cref="DataNotFoundException">If no fragments exist for the parent.</exception>
        IEnumerable<string> GetFragments(string parentId);
        /// <summary>
        /// Gets the parent fragments list
        /// </summary>
        /// <param name="parentId">The parent Entity id</param>
        /// <returns>The collection of fragment object global ids if found else <see langref="null"/>.</returns>
        /// <exception cref="ArgumentNullException">If <paramref name="parent"/> is <see langref="null"/> or empty.</exception>
        IEnumerable<string> FindFragments(string parentId);
        /// <summary>
        /// Gets the parent fragments list using cache first, if not in cache gest the fragment list from provider.
        /// </summary>
        /// <param name="parentId">The parent Entity id</param>
        /// <returns>The collection of fragment object global ids</returns>
        /// <exception cref="ArgumentNullException">If <paramref name="parent"/> is <see langref="null"/> or empty.</exception>
        /// <exception cref="DataNotFoundException">If no fragments exist for the parent.</exception>
        IEnumerable<string> CachedGetFragments(string parentId);
        /// <summary>
        /// Finds the parent fragments list using cache first, if not in cache gest the fragment list from provider.
        /// </summary>
        /// <param name="parentId">The parent Entity id</param>
        /// <returns>The collection of fragment object global ids if exist else <see langref="null"/>.</returns>
        /// <exception cref="ArgumentNullException">If <paramref name="parent"/> is <see langref="null"/> or empty.</exception>
        IEnumerable<string> CachedFindFragments(string parentId);
    }
    public interface IEntityFragmentService<OI> : IEntityFragmentService
        where OI : IEntityFragment
    {
    }
}
